package com.epoint.springboot.dao;

import com.epoint.springboot.bean.UserDO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;


/**
 * spring jpa
 * 嵌入式数据库  h2
 */
public interface UserDao extends JpaRepository<UserDO, Integer>{

	@Query(value="select u from UserDO u where u.userName=?1")
	UserDO findByUserName(String string);

	UserDO findByUserNameAndUserIp(String string, String ip);

	Page<UserDO> findByUserName(String string, Pageable pageable);
}
